﻿Imports System.Data.SQLite

Public Class frmClases
    Dim DS As New DataSet

    Private Sub frmClases_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim path1 As String = AppDomain.CurrentDomain.BaseDirectory
        Dim dbpath As String = path1.Replace("\bin\Debug\", "\StudentApp2.s3db")
        Dim cnnString As String = String.Format("Data Source={0}", dbpath)

        Using CNN As New SQLiteConnection(cnnString)
            CNN.Open()

            Using DA As New SQLiteDataAdapter
                DA.SelectCommand = New SQLiteCommand("SELECT * FROM Clase", CNN)
                DA.Fill(DS, "Clase")
                dgClases.DataSource = DS.Tables("Clase")
            End Using

            CNN.Close()
        End Using
    End Sub
End Class